# -*- coding: utf-8 -*-

from keras.applications.inception_v3 import InceptionV3
import keras
import numpy as np
from keras.preprocessing import image
from keras.applications.inception_v3 import InceptionV3
from keras.applications.inception_v3 import preprocess_input
from keras.applications.inception_v3 import decode_predictions

model = InceptionV3()
model.summary()
img = image.load_img('elephant.jpg',target_size=(299,299))
x = image.img_to_array(img)
x = np.expand_dims(x,axis=0)   #这三行的意思是提取 图片特征
x = preprocess_input(x)
preds = model.predict(x)
print('Predicted:',decode_predictions(preds,top=3)[0])